clc;
% syms s;
P=(s+3)^2*(s^2+3*s+2)*(s^3+12*s^2+48*s+64)
% pretty(P)
P1=simplify(subs(P,s,(z-1)/(z+1))),latex(P1)
pretty(P1)%运行结果与书本不一致
latex(P1)